<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\FormClickRecordSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '注册表单记录';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="form-click-record-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <!-- <?= Html::a('Create Form Click Record', ['create'], ['class' => 'btn btn-success']) ?> -->
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            // ['class' => 'yii\grid\SerialColumn'],

            // 'id',
            'openid',
            'identifier',
            'redirect_url:url',
            [
                'attribute' => 'clicks',
                'options' => [
                    'width' => 60,
                ],
            ],
            [
                'attribute' => 'status',
                'format' => 'raw',
                'options' => [
                    'width' => 120,
                ],
				'filter' => Html::activeDropDownList(
					$searchModel,
					'status',
					['1' => '未注册', '2' => '已注册'],
					['class' => 'form-control', 'prompt'=>'请选择']
				),
				'value' => function($data) {
					return ($data->status == 1) ? '未注册' : '已注册';
				},
            ],
            'created_at:datetime',
            'updated_at:datetime',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '{view}'
            ],
        ],
    ]); ?>
</div>
